package com.guaoran.common.datasource;

import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

/**
 * @author : guaoran
 * @Description 数据源路由切换
 * @date :2019/4/15 21:29
 */
public class ThreadLocalRoutingDataSource extends AbstractRoutingDataSource{
    @Override
    protected Object determineCurrentLookupKey() {
        DataSources dataSources = DataSourceTypeManager.get();
        logger.debug("datasource:"+dataSources.name());
        return dataSources;
    }
}
